package com.yanqu.road.server.cmd.marriage;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.marriage.MarriageProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.marriage.CrossUnionWorldMarriageMgr;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_CROSS_WORLD_CLEAR_MARRIAGE_STATE, desc = "取消全服联姻(仅清除状态，不需要返回)")
public class CrossWorldMarriageClearStateCmd extends CrossCommand {
    private String childUid;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        MarriageProto.MarriageApplyCancelReqMsg reqMsg = MarriageProto.MarriageApplyCancelReqMsg.parseFrom(packet.getBytes());
        childUid = reqMsg.getChildUid();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        ret = CrossUnionWorldMarriageMgr.cancelPublish(serverId, 0, childUid);
    }

    @Override
    public void sendData() {
    }
}
